#!/bin/bash


## load modules 
module load gcc/4.8.2 gdc angsd/0.919 python/3.6.1 pcangsd/0.98


#Define all paths needed
input="/path/to/input/beagle/file/"
out="/path/to/write/output/files"


###############################################################################################

#Then run PCAngsd on beagle (genotype likelihood) file:
pcangsd.py -beagle ${input}/min_32_ind.beagle.gz -o ${out}/min_32_ind -minMaf 0.05 -e 3 -admix
#convert from numpy to csv
python ./numpy_to_csv.py -i ${out}/min_32_ind.cov.npy  -o ${out}/min_32_ind.cov
python ./numpy_to_csv.py -i ${out}/min_32_ind.admix.Q.npy  -o ${out}/min_32_ind..qopt

